<?php

namespace App\Admin\Repositories;

use App\Models\JobPositionRecommendModel as Model;
use Dcat\Admin\Form;
use Dcat\Admin\Repositories\EloquentRepository;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\DB;

class JobPositionRecommend extends EloquentRepository
{
    /**
     * Model.
     *
     * @var string
     */
    protected $eloquentClass = Model::class;
    public function store(Form $form)
    {
        $idArray = $form->input('job_position_id');
        $idArray = explode(',', $idArray);
        foreach ($idArray as $id) {
            $res = $this->eloquentClass::query()->updateOrCreate([
                'job_position_id' => $id
            ]);
        }
        return $res;
    }
}
